home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-08-17 | 15.1 KB | 502 lines | [TEXT/MPS ] |
- ;
- ; File: Fonts.a
- ;
- ; Contains: Font Manager Interfaces.
- ;
- ; Version: Technology: MacOS 8
- ; Release: Universal Interfaces 3.2
- ;
- ; Copyright: © 1985-1998 by Apple Computer, Inc., all rights reserved
- ;
- ; Bugs?: For bug reports, consult the following page on
- ; the World Wide Web:
- ;
- ; http://developer.apple.com/bugreporter/
- ;
- ;
- IF &TYPE('__FONTS__') = 'UNDEFINED' THEN
- __FONTS__ SET 1
-
- IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
- include 'MacTypes.a'
- ENDIF
- IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
- include 'Quickdraw.a'
- ENDIF
-
-
- systemFont EQU 0
- applFont EQU 1
- ; kPlatformDefaultGuiFontID is used in QuickTime 3.0
- IF TARGET_OS_MAC THEN
-
- kPlatformDefaultGuiFontID EQU 1
- ELSE
-
- kPlatformDefaultGuiFontID EQU -1
- ENDIF ; TARGET_OS_MAC
- ;
- ; The following font constants are deprecated.
- ; Please use GetFNum() to look up the font ID by name.
- ;
-
-
- kFontIDNewYork EQU 2
- kFontIDGeneva EQU 3
- kFontIDMonaco EQU 4
- kFontIDVenice EQU 5
- kFontIDLondon EQU 6
- kFontIDAthens EQU 7
- kFontIDSanFrancisco EQU 8
- kFontIDToronto EQU 9
- kFontIDCairo EQU 11
- kFontIDLosAngeles EQU 12
- kFontIDTimes EQU 20
- kFontIDHelvetica EQU 21
- kFontIDCourier EQU 22
- kFontIDSymbol EQU 23
- kFontIDMobile EQU 24
- IF OLDROUTINENAMES THEN
-
- newYork EQU 2
- geneva EQU 3
- monaco EQU 4
- venice EQU 5
- london EQU 6
- athens EQU 7
- sanFran EQU 8
- toronto EQU 9
- cairo EQU 11
- losAngeles EQU 12
- times EQU 20
- helvetica EQU 21
- courier EQU 22
- symbol EQU 23
- mobile EQU 24
- ENDIF ; OLDROUTINENAMES
-
- commandMark EQU 17
- checkMark EQU 18
- diamondMark EQU 19
- appleMark EQU 20
-
- propFont EQU 36864
- prpFntH EQU 36865
- prpFntW EQU 36866
- prpFntHW EQU 36867
- fixedFont EQU 45056
- fxdFntH EQU 45057
- fxdFntW EQU 45058
- fxdFntHW EQU 45059
- fontWid EQU 44208
- FMInput RECORD 0
- family ds.w 1 ; offset: $0 (0)
- size ds.w 1 ; offset: $2 (2)
- face ds.b 1 ; offset: $4 (4)
- needBits ds.b 1 ; offset: $5 (5)
- device ds.w 1 ; offset: $6 (6)
- numer ds Point ; offset: $8 (8)
- denom ds Point ; offset: $C (12)
- sizeof EQU * ; size: $10 (16)
- ENDR
- FMOutput RECORD 0
- errNum ds.w 1 ; offset: $0 (0)
- fontHandle ds.l 1 ; offset: $2 (2) ; the previous "privateFontResult" was a mistake!
- boldPixels ds.b 1 ; offset: $6 (6)
- italicPixels ds.b 1 ; offset: $7 (7)
- ulOffset ds.b 1 ; offset: $8 (8)
- ulShadow ds.b 1 ; offset: $9 (9)
- ulThick ds.b 1 ; offset: $A (10)
- shadowPixels ds.b 1 ; offset: $B (11)
- extra ds.b 1 ; offset: $C (12)
- ascent ds.b 1 ; offset: $D (13)
- descent ds.b 1 ; offset: $E (14)
- widMax ds.b 1 ; offset: $F (15)
- leading ds.b 1 ; offset: $10 (16)
- curStyle ds.b 1 ; offset: $11 (17)
- numer ds Point ; offset: $12 (18)
- denom ds Point ; offset: $16 (22)
- sizeof EQU * ; size: $1A (26)
- ENDR
- ; typedef struct FMOutput * FMOutPtr
-
- ; typedef struct FMOutput * FMOutputPtr
-
- FontRec RECORD 0
- fontType ds.w 1 ; offset: $0 (0) ; font type
- firstChar ds.w 1 ; offset: $2 (2) ; ASCII code of first character
- lastChar ds.w 1 ; offset: $4 (4) ; ASCII code of last character
- widMax ds.w 1 ; offset: $6 (6) ; maximum character width
- kernMax ds.w 1 ; offset: $8 (8) ; negative of maximum character kern
- nDescent ds.w 1 ; offset: $A (10) ; negative of descent
- fRectWidth ds.w 1 ; offset: $C (12) ; width of font rectangle
- fRectHeight ds.w 1 ; offset: $E (14) ; height of font rectangle
- owTLoc ds.w 1 ; offset: $10 (16) ; offset to offset/width table
- ascent ds.w 1 ; offset: $12 (18) ; ascent
- descent ds.w 1 ; offset: $14 (20) ; descent
- leading ds.w 1 ; offset: $16 (22) ; leading
- rowWords ds.w 1 ; offset: $18 (24) ; row width of bit image / 2
- sizeof EQU * ; size: $1A (26)
- ENDR
- ; typedef struct FontRec * FontRecPtr
-
- ; typedef FontRecPtr * FontRecHdl
-
- FMetricRec RECORD 0
- ascent ds.l 1 ; offset: $0 (0) ; base line to top
- descent ds.l 1 ; offset: $4 (4) ; base line to bottom
- leading ds.l 1 ; offset: $8 (8) ; leading between lines
- widMax ds.l 1 ; offset: $C (12) ; maximum character width
- wTabHandle ds.l 1 ; offset: $10 (16) ; handle to font width table
- sizeof EQU * ; size: $14 (20)
- ENDR
-
- ; typedef struct FMetricRec FMetricRec, *FMetricRecPtr;
- ; typedef FMetricRecPtr *FMetricRecHandle;
-
-
- ; typedef struct FMetricRec * FMetricRecPtr
-
- ; typedef FMetricRecPtr * FMetricRecHandle
-
- WidEntry RECORD 0
- widStyle ds.w 1 ; offset: $0 (0) ; style entry applies to
- sizeof EQU * ; size: $2 (2)
- ENDR
- WidTable RECORD 0
- numWidths ds.w 1 ; offset: $0 (0) ; number of entries - 1
- sizeof EQU * ; size: $2 (2)
- ENDR
- AsscEntry RECORD 0
- fontSize ds.w 1 ; offset: $0 (0)
- fontStyle ds.w 1 ; offset: $2 (2)
- fontID ds.w 1 ; offset: $4 (4) ; font resource ID
- sizeof EQU * ; size: $6 (6)
- ENDR
- FontAssoc RECORD 0
- numAssoc ds.w 1 ; offset: $0 (0) ; number of entries - 1
- sizeof EQU * ; size: $2 (2)
- ENDR
- StyleTable RECORD 0
- fontClass ds.w 1 ; offset: $0 (0)
- offset ds.l 1 ; offset: $2 (2)
- reserved ds.l 1 ; offset: $6 (6)
- indexes ds.b 48 ; offset: $A (10)
- sizeof EQU * ; size: $3A (58)
- ENDR
- NameTable RECORD 0
- stringCount ds.w 1 ; offset: $0 (0)
- baseFontName ds Str255 ; offset: $2 (2)
- sizeof EQU * ; size: $102 (258)
- ENDR
- KernPair RECORD 0
- kernFirst ds.b 1 ; offset: $0 (0) ; 1st character of kerned pair
- kernSecond ds.b 1 ; offset: $1 (1) ; 2nd character of kerned pair
- kernWidth ds.w 1 ; offset: $2 (2) ; kerning in 1pt fixed format
- sizeof EQU * ; size: $4 (4)
- ENDR
- KernEntry RECORD 0
- kernStyle ds.w 1 ; offset: $0 (0) ; style the entry applies to
- kernLength ds.w 1 ; offset: $2 (2) ; length of this entry
- sizeof EQU * ; size: $4 (4)
- ENDR
- KernTable RECORD 0
- numKerns ds.w 1 ; offset: $0 (0) ; number of kerning entries
- sizeof EQU * ; size: $2 (2)
- ENDR
- WidthTable RECORD 0
- tabData ds.l 256 ; offset: $0 (0) ; character widths
- tabFont ds.l 1 ; offset: $400 (1024) ; font record used to build table - the previous FontResult was a mistake!
- sExtra ds.l 1 ; offset: $404 (1028) ; space extra used for table
- style ds.l 1 ; offset: $408 (1032) ; extra due to style
- fID ds.w 1 ; offset: $40C (1036) ; font family ID
- fSize ds.w 1 ; offset: $40E (1038) ; font size request
- face ds.w 1 ; offset: $410 (1040) ; style (face) request
- device ds.w 1 ; offset: $412 (1042) ; device requested
- inNumer ds Point ; offset: $414 (1044) ; scale factors requested
- inDenom ds Point ; offset: $418 (1048) ; scale factors requested
- aFID ds.w 1 ; offset: $41C (1052) ; actual font family ID for table
- fHand ds.l 1 ; offset: $41E (1054) ; family record used to build up table
- usedFam ds.b 1 ; offset: $422 (1058) ; used fixed point family widths
- aFace ds.b 1 ; offset: $423 (1059) ; actual face produced
- vOutput ds.w 1 ; offset: $424 (1060) ; vertical scale output value
- hOutput ds.w 1 ; offset: $426 (1062) ; horizontal scale output value
- vFactor ds.w 1 ; offset: $428 (1064) ; vertical scale output value
- hFactor ds.w 1 ; offset: $42A (1066) ; horizontal scale output value
- aSize ds.w 1 ; offset: $42C (1068) ; actual size of actual font used
- tabSize ds.w 1 ; offset: $42E (1070) ; total size of table
- sizeof EQU * ; size: $430 (1072)
- ENDR
- ; typedef struct WidthTable * WidthTablePtr
-
- ; typedef WidthTablePtr * WidthTableHdl
-
-
- FamRec RECORD 0
- ffFlags ds.w 1 ; offset: $0 (0) ; flags for family
- ffFamID ds.w 1 ; offset: $2 (2) ; family ID number
- ffFirstChar ds.w 1 ; offset: $4 (4) ; ASCII code of 1st character
- ffLastChar ds.w 1 ; offset: $6 (6) ; ASCII code of last character
- ffAscent ds.w 1 ; offset: $8 (8) ; maximum ascent for 1pt font
- ffDescent ds.w 1 ; offset: $A (10) ; maximum descent for 1pt font
- ffLeading ds.w 1 ; offset: $C (12) ; maximum leading for 1pt font
- ffWidMax ds.w 1 ; offset: $E (14) ; maximum widMax for 1pt font
- ffWTabOff ds.l 1 ; offset: $10 (16) ; offset to width table
- ffKernOff ds.l 1 ; offset: $14 (20) ; offset to kerning table
- ffStylOff ds.l 1 ; offset: $18 (24) ; offset to style mapping table
- ffProperty ds.w 9 ; offset: $1C (28) ; style property info
- ffIntl ds.w 2 ; offset: $2E (46) ; for international use
- ffVersion ds.w 1 ; offset: $32 (50) ; version number
- sizeof EQU * ; size: $34 (52)
- ENDR
- ; typedef SInt16 FontPointSize
-
- ; typedef SInt16 FontFamilyID
-
- ;
- ; pascal void InitFonts(void )
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- _InitFonts: OPWORD $A8FE
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION InitFonts
- ENDIF
-
- ;
- ; pascal void GetFontName(short familyID, Str255 name)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- _GetFontName: OPWORD $A8FF
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetFontName
- ENDIF
-
- ;
- ; pascal void GetFNum(ConstStr255Param name, short *familyID)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- _GetFNum: OPWORD $A900
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetFNum
- ENDIF
-
- ;
- ; pascal Boolean RealFont(short fontNum, short size)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- _RealFont: OPWORD $A902
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION RealFont
- ENDIF
-
- ;
- ; pascal void SetFontLock(Boolean lockFlag)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- _SetFontLock: OPWORD $A903
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION SetFontLock
- ENDIF
-
- ;
- ; pascal FMOutPtr FMSwapFont(const FMInput *inRec)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- _FMSwapFont: OPWORD $A901
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION FMSwapFont
- ENDIF
-
- ;
- ; pascal void SetFScaleDisable(Boolean fscaleDisable)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- _SetFScaleDisable: OPWORD $A834
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION SetFScaleDisable
- ENDIF
-
- ;
- ; pascal void FontMetrics(FMetricRecPtr theMetrics)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- _FontMetrics: OPWORD $A835
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION FontMetrics
- ENDIF
-
- ;
- ; pascal void SetFractEnable(Boolean fractEnable)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- _SetFractEnable: OPWORD $A814
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION SetFractEnable
- ENDIF
-
- ;
- ; pascal short GetDefFontSize(void )
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetDefFontSize
- dc.w $3EB8
- dc.w $0BA8
- dc.w $6604
- dc.w $3EBC
- dc.w $000C
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetDefFontSize
- ENDIF
-
- ;
- ; pascal Boolean IsOutline(Point numer, Point denom)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _IsOutline
- moveq #0,D0
- dc.w $A854
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IsOutline
- ENDIF
-
- ;
- ; pascal void SetOutlinePreferred(Boolean outlinePreferred)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _SetOutlinePreferred
- moveq #1,D0
- dc.w $A854
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION SetOutlinePreferred
- ENDIF
-
- ;
- ; pascal Boolean GetOutlinePreferred(void )
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetOutlinePreferred
- moveq #9,D0
- dc.w $A854
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetOutlinePreferred
- ENDIF
-
- ;
- ; pascal OSErr OutlineMetrics(short byteCount, const void *textPtr, Point numer, Point denom, short *yMax, short *yMin, FixedPtr awArray, FixedPtr lsbArray, RectPtr boundsArray)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _OutlineMetrics
- moveq #8,D0
- dc.w $A854
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION OutlineMetrics
- ENDIF
-
- ;
- ; pascal void SetPreserveGlyph(Boolean preserveGlyph)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _SetPreserveGlyph
- moveq #10,D0
- dc.w $A854
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION SetPreserveGlyph
- ENDIF
-
- ;
- ; pascal Boolean GetPreserveGlyph(void )
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetPreserveGlyph
- moveq #11,D0
- dc.w $A854
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetPreserveGlyph
- ENDIF
-
- ;
- ; pascal OSErr FlushFonts(void )
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _FlushFonts
- moveq #12,D0
- dc.w $A854
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION FlushFonts
- ENDIF
-
- ;
- ; pascal short GetSysFont(void)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetSysFont &dest=(sp)
- move.w $0BA6,&dest
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetSysFont
- ENDIF
-
- ;
- ; pascal short GetAppFont(void)
- ;
- IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
- Macro
- _GetAppFont &dest=(sp)
- move.w $0984,&dest
- EndM
- ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION GetAppFont
- ENDIF
-
- ; ---------------------------------------------------------------------------------
- ;
- ; pascal OSStatus SetAntiAliasedTextEnabled(Boolean inEnable, SInt16 inMinFontSize)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION SetAntiAliasedTextEnabled
- ENDIF
-
- ;
- ; pascal Boolean IsAntiAliasedTextEnabled(SInt16 *outMinFontSize)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION IsAntiAliasedTextEnabled
- ENDIF
-
- ; ---------------------------------------------------------------------------------
- ;
- ; pascal void QDTextBounds(short byteCount, const void *textAddr, Rect *bounds)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION QDTextBounds
- ENDIF
-
- ;
- ; pascal OSErr FetchFontInfo(SInt16 fontID, SInt16 fontSize, SInt16 fontStyle, FontInfo *info)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION FetchFontInfo
- ENDIF
-
- ; ---------------------------------------------------------------------------------
-
- ENDIF ; __FONTS__
-
-